package com.bxw.chatgptapi;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.xml.ws.Response;

@SpringBootApplication
@RestController
@Slf4j
public class ChatgptApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(ChatgptApiApplication.class, args);
    }

    @GetMapping("/verify")
    public ResponseEntity<String> verify(@RequestParam(value = "token") String token) {
        log.info("接收验证token=" + token);
        if("success".equals(token)) {
            log.info("校验成功");
            return ResponseEntity.status(HttpStatus.OK).build();
        }else {
            log.info("校验失败");
            return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
        }


    }

    @GetMapping("/success")
    public String success() {
        return "验证成功进入服务";
    }


}
